//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Globalization;
using System.Windows.Data;
using OpenLS.Chart.UI.Internals;

namespace OpenLS.Chart.UI
{
    class ScalerFactory : IMultiValueConverter
    {
        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            double? logBase = null;
            if (values[1] is double)
                logBase = (double)values[1];
            return new Scaler((AxisOrientation)values[0],
                logBase, (double)values[2], (double)values[3]);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        #endregion
    }
}
